
#line 1 "..\user\hmi_driver.c" /0
  
#line 1 "..\user\hmi_driver.h" /0






 
 
 
 
 
 
 
 
  
#line 1 "..\user\hmi_user_uart.h" /0






 
 
 
 
 
 
  
#line 1 "..\user\STC8.H" /0
 
 
 
 
 
 
 
 
 sfr ACC         =   0xe0;
 sfr B           =   0xf0;
 sfr PSW         =   0xd0;
 sbit CY         =   PSW^7;
 sbit AC         =   PSW^6;
 sbit F0         =   PSW^5;
 sbit RS1        =   PSW^4;
 sbit RS0        =   PSW^3;
 sbit OV         =   PSW^2;
 sbit P          =   PSW^0;
 sfr SP          =   0x81;
 sfr DPL         =   0x82;
 sfr DPH         =   0x83;
 sfr TA          =   0xae;
 sfr DPS         =   0xe3;
 sfr DPL1        =   0xe4;
 sfr DPH1        =   0xe5;
 
 
 
 sfr P0          =   0x80;
 sfr P1          =   0x90;
 sfr P2          =   0xa0;
 sfr P3          =   0xb0;
 sfr P4          =   0xc0;
 sfr P5          =   0xc8;
 sfr P6          =   0xe8;
 sfr P7          =   0xf8;
 sfr P0M0        =   0x94;
 sfr P0M1        =   0x93;
 sfr P1M0        =   0x92;
 sfr P1M1        =   0x91;
 sfr P2M0        =   0x96;
 sfr P2M1        =   0x95;
 sfr P3M0        =   0xb2;
 sfr P3M1        =   0xb1;
 sfr P4M0        =   0xb4;
 sfr P4M1        =   0xb3;
 sfr P5M0        =   0xca;
 sfr P5M1        =   0xc9;
 sfr P6M0        =   0xcc;
 sfr P6M1        =   0xcb;
 sfr P7M0        =   0xe2;
 sfr P7M1        =   0xe1;
 
 sbit P00        =   P0^0;
 sbit P01        =   P0^1;
 sbit P02        =   P0^2;
 sbit P03        =   P0^3;
 sbit P04        =   P0^4;
 sbit P05        =   P0^5;
 sbit P06        =   P0^6;
 sbit P07        =   P0^7;
 sbit P10        =   P1^0;
 sbit P11        =   P1^1;
 sbit P12        =   P1^2;
 sbit P13        =   P1^3;
 sbit P14        =   P1^4;
 sbit P15        =   P1^5;
 sbit P16        =   P1^6;
 sbit P17        =   P1^7;
 sbit P20        =   P2^0;
 sbit P21        =   P2^1;
 sbit P22        =   P2^2;
 sbit P23        =   P2^3;
 sbit P24        =   P2^4;
 sbit P25        =   P2^5;
 sbit P26        =   P2^6;
 sbit P27        =   P2^7;
 sbit P30        =   P3^0;
 sbit P31        =   P3^1;
 sbit P32        =   P3^2;
 sbit P33        =   P3^3;
 sbit P34        =   P3^4;
 sbit P35        =   P3^5;
 sbit P36        =   P3^6;
 sbit P37        =   P3^7;
 sbit P40        =   P4^0;
 sbit P41        =   P4^1;
 sbit P42        =   P4^2;
 sbit P43        =   P4^3;
 sbit P44        =   P4^4;
 sbit P45        =   P4^5;
 sbit P46        =   P4^6;
 sbit P47        =   P4^7;
 sbit P50        =   P5^0;
 sbit P51        =   P5^1;
 sbit P52        =   P5^2;
 sbit P53        =   P5^3;
 sbit P54        =   P5^4;
 sbit P55        =   P5^5;
 sbit P56        =   P5^6;
 sbit P57        =   P5^7;
 sbit P60        =   P6^0;
 sbit P61        =   P6^1;
 sbit P62        =   P6^2;
 sbit P63        =   P6^3;
 sbit P64        =   P6^4;
 sbit P65        =   P6^5;
 sbit P66        =   P6^6;
 sbit P67        =   P6^7;
 sbit P70        =   P7^0;
 sbit P71        =   P7^1;
 sbit P72        =   P7^2;
 sbit P73        =   P7^3;
 sbit P74        =   P7^4;
 sbit P75        =   P7^5;
 sbit P76        =   P7^6;
 sbit P77        =   P7^7;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 sfr PCON        =   0x87;
 
 
 
 
 
 
 
 
 sfr AUXR        =   0x8e;
 
 
 
 
 
 
 
 
 sfr AUXR2       =   0x97;
 
 sfr BUS_SPEED   =   0xa1;
 sfr P_SW1       =   0xa2;
 sfr P_SW2       =   0xba;
 
 sfr VOCTRL      =   0xbb;
 sfr RSTCFG      =   0xff;
 
 
 
 
 
 
 
 
 
 
 sfr IE          =   0xa8;
 sbit EA         =   IE^7;
 sbit ELVD       =   IE^6;
 sbit EADC       =   IE^5;
 sbit ES         =   IE^4;
 sbit ET1        =   IE^3;
 sbit EX1        =   IE^2;
 sbit ET0        =   IE^1;
 sbit EX0        =   IE^0;
 sfr IE2         =   0xaf;
 
 
 
 
 
 
 
 sfr IP          =   0xb8;
 sbit PPCA       =   IP^7;
 sbit PLVD       =   IP^6;
 sbit PADC       =   IP^5;
 sbit PS         =   IP^4;
 sbit PT1        =   IP^3;
 sbit PX1        =   IP^2;
 sbit PT0        =   IP^1;
 sbit PX0        =   IP^0;
 sfr IP2         =   0xb5;
 
 
 
 
 
 
 
 sfr IPH         =   0xb7;
 
 
 
 
 
 
 
 
 sfr IP2H        =   0xb6;
 
 
 
 
 
 
 
 sfr INTCLKO     =   0x8f;
 
 
 
 
 
 
 sfr AUXINTIF    =   0xef;
 
 
 
 
 
 
 
 
 sfr TCON        =   0x88;
 sbit TF1        =   TCON^7;
 sbit TR1        =   TCON^6;
 sbit TF0        =   TCON^5;
 sbit TR0        =   TCON^4;
 sbit IE1        =   TCON^3;
 sbit IT1        =   TCON^2;
 sbit IE0        =   TCON^1;
 sbit IT0        =   TCON^0;
 sfr TMOD        =   0x89;
 
 
 
 
 
 
 
 
 sfr TL0         =   0x8a;
 sfr TL1         =   0x8b;
 sfr TH0         =   0x8c;
 sfr TH1         =   0x8d;
 sfr T4T3M       =   0xd1;
 
 
 
 
 
 
 
 
 sfr T4H         =   0xd2;
 sfr T4L         =   0xd3;
 sfr T3H         =   0xd4;
 sfr T3L         =   0xd5;
 sfr T2H         =   0xd6;
 sfr T2L         =   0xd7;
 sfr TH4         =   0xd2;
 sfr TL4         =   0xd3;
 sfr TH3         =   0xd4;
 sfr TL3         =   0xd5;
 sfr TH2         =   0xd6;
 sfr TL2         =   0xd7;
 sfr WKTCL       =   0xaa;
 sfr WKTCH       =   0xab;
 
 sfr WDT_CONTR   =   0xc1;
 
 
 
 
 
 
 sfr SCON        =   0x98;
 sbit SM0        =   SCON^7;
 sbit SM1        =   SCON^6;
 sbit SM2        =   SCON^5;
 sbit REN        =   SCON^4;
 sbit TB8        =   SCON^3;
 sbit RB8        =   SCON^2;
 sbit TI         =   SCON^1;
 sbit RI         =   SCON^0;
 sfr SBUF        =   0x99;
 sfr S2CON       =   0x9a;
 
 
 
 
 
 
 
 
 sfr S2BUF       =   0x9b;
 sfr S3CON       =   0xac;
 
 
 
 
 
 
 
 
 sfr S3BUF       =   0xad;
 sfr S4CON       =   0x84;
 
 
 
 
 
 
 
 
 sfr S4BUF       =   0x85;
 sfr SADDR       =   0xa9;
 sfr SADEN       =   0xb9;
 
 
 sfr ADC_CONTR   =   0xbc;
 
 
 
 sfr ADC_RES     =   0xbd;
 sfr ADC_RESL    =   0xbe;
 sfr ADCCFG      =   0xde;
 
 
 
 sfr SPSTAT      =   0xcd;
 
 
 sfr SPCTL       =   0xce;
 
 
 
 
 
 
 sfr SPDAT       =   0xcf;
 
 
 sfr IAP_DATA    =   0xc2;
 sfr IAP_ADDRH   =   0xc3;
 sfr IAP_ADDRL   =   0xc4;
 sfr IAP_CMD     =   0xc5;
 
 
 
 
 sfr IAP_TRIG    =   0xc6;
 sfr IAP_CONTR   =   0xc7;
 
 
 
 
 sfr ISP_DATA    =   0xc2;
 sfr ISP_ADDRH   =   0xc3;
 sfr ISP_ADDRL   =   0xc4;
 sfr ISP_CMD     =   0xc5;
 sfr ISP_TRIG    =   0xc6;
 sfr ISP_CONTR   =   0xc7;
 
 
 sfr CMPCR1      =   0xe6;
 
 
 
 
 
 
 
 
 sfr CMPCR2      =   0xe7;
 
 
 
 
 sfr CCON        =   0xd8;
 sbit CF         =   CCON^7;
 sbit CR         =   CCON^6;
 sbit CCF3       =   CCON^3;
 sbit CCF2       =   CCON^2;
 sbit CCF1       =   CCON^1;
 sbit CCF0       =   CCON^0;
 sfr CMOD        =   0xd9;
 
 
 sfr CL          =   0xe9;
 sfr CH          =   0xf9;
 sfr CCAPM0      =   0xda;
 
 
 
 
 
 
 
 sfr CCAPM1      =   0xdb;
 
 
 
 
 
 
 
 sfr CCAPM2      =   0xdc;
 
 
 
 
 
 
 
 sfr CCAPM3      =   0xdd;
 
 
 
 
 
 
 
 sfr CCAP0L      =   0xea;
 sfr CCAP1L      =   0xeb;
 sfr CCAP2L      =   0xec;
 sfr CCAP3L      =   0xed;
 sfr CCAP0H      =   0xfa;
 sfr CCAP1H      =   0xfb;
 sfr CCAP2H      =   0xfc;
 sfr CCAP3H      =   0xfd;
 sfr PCA_PWM0    =   0xf2;
 sfr PCA_PWM1    =   0xf3;
 sfr PCA_PWM2    =   0xf4;
 sfr PCA_PWM3    =   0xf5;
 
 
 sfr PWMCFG      =   0xf1;
 
 
 sfr PWMIF       =   0xf6;
 
 
 
 
 
 
 
 
 sfr PWMFDCR     =   0xf7;
 
 
 
 
 
 
 
 
 sfr PWMCR       =   0xfe;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#line 13 "..\user\hmi_user_uart.h" /0
 
 
 
 
 
 
 
 


 
 void ConfigUART(unsigned long baud1);
 void UartInit();



 
 void  SendChar(unsigned char c);
 
 
 
 
#line 15 "..\user\hmi_driver.h" /0
 
 





 
  unsigned short int CheckCRC16(unsigned char *buffer,unsigned short int n);
 



 
 void DelayMS(unsigned int n);
 


 
 void LockDeviceConfig(void);
 


 
 void UnlockDeviceConfig(void);
 





 
 void SetCommBps(unsigned char option);
 


 
 void SetHandShake(void);
 



 
 void SetFcolor(unsigned short int color);
 



 
 void SetBcolor(unsigned short int color);
 


 
 void GUI_CleanScreen();
 




 
 void SetTextSpace(unsigned char x_w, unsigned char y_w);
 





 
 void SetFont_Region(unsigned char enable,unsigned short int width,unsigned short int height );
 




 
 void SetFilterColor(unsigned short int fillcolor_dwon, unsigned short int fillcolor_up);
 







 
 void DisText(unsigned short int x, unsigned short int y,unsigned char back,unsigned char font,unsigned char *strings );
 







 
 void DisCursor(unsigned char enable,unsigned short int x, unsigned short int y,unsigned char width,unsigned char height );
 




 
 void DisFull_Image(unsigned short int image_id,unsigned char masken);
 






 
 void DisArea_Image(unsigned short int x,unsigned short int y,unsigned short int image_id,unsigned char masken);
 










 
 void DisCut_Image(unsigned short int x,unsigned short int y,unsigned short int image_id,unsigned short int image_x,unsigned short int image_y,
  unsigned short int image_l, unsigned short int image_w,unsigned char masken);
 







 
 void DisFlashImage(unsigned short int x,unsigned short int y,unsigned short int flashimage_id,unsigned char enable,unsigned char playnum);
 




 
 void GUI_Dot(unsigned short int x,unsigned short int y);
 






 
 void GUI_Line(unsigned short int x0, unsigned short int y0, unsigned short int x1, unsigned short int y1);
 





 
 void GUI_ConDots(unsigned char mode,unsigned short int *dot,unsigned short int dot_cnt);
 





 
 void GUI_Circle(unsigned short int x0, unsigned short int y0, unsigned short int r);
 





 
 void GUI_CircleFill(unsigned short int x0, unsigned short int y0, unsigned short int r);
 







 
 void GUI_Arc(unsigned short int x,unsigned short int y, unsigned short int r,unsigned short int sa, unsigned short int ea);
 






 
 void GUI_Rectangle(unsigned short int x0, unsigned short int y0, unsigned short int x1,unsigned short int y1 );
 






 
 void GUI_RectangleFill(unsigned short int x0, unsigned short int y0, unsigned short int x1,unsigned short int y1 );
 






 
 void GUI_Ellipse (unsigned short int x0, unsigned short int y0, unsigned short int x1,unsigned short int y1 );
 






 
 void GUI_EllipseFill (unsigned short int x0, unsigned short int y0, unsigned short int x1,unsigned short int y1 );
 






 
 void SetBackLight(unsigned char light_level);
 



 
 void SetBuzzer(unsigned char time);
 






 
 void SetTouchPaneOption(unsigned char enbale,unsigned char beep_on,unsigned char work_mode,unsigned char press_calibration);
 


 
 void	CalibrateTouchPane();
 


 
 void TestTouchPane();
 













 
 void WriteLayer(unsigned char layer);
 



 
 void DisplyLayer(unsigned char layer);
 



 
 void ClearLayer(unsigned char layer);
 





 
 void WriteUserFlash(unsigned long startAddress,unsigned short int length,unsigned char *_data);
 




 
 void ReadUserFlash(unsigned long startAddress,unsigned short int length);
 




 
 void CopyLayer(unsigned char src_layer,unsigned char dest_layer);
 



 
 void SetScreen(unsigned short int screen_id);
 


 
 void GetScreen();
 








 
 void SetScreenUpdateEnable(unsigned char enable);
 





 
 void SetControlFocus(unsigned short int screen_id,unsigned short int control_id,unsigned char focus);
 





 
 void SetControlVisiable(unsigned short int screen_id,unsigned short int control_id,unsigned char visible);
 





 
 void SetControlEnable(unsigned short int screen_id,unsigned short int control_id,unsigned char enable);
 




 
 void GetControlValue(unsigned short int screen_id,unsigned short int control_id);
 





 
 void SetButtonValue(unsigned short int screen_id,unsigned short int control_id,unsigned char value);
 





 
 void SetTextValue(unsigned short int screen_id,unsigned short int control_id,unsigned char *str);
 





 
 void SetProgressValue(unsigned short int screen_id,unsigned short int control_id,unsigned long value);
 





 
 void SetMeterValue(unsigned short int screen_id,unsigned short int control_id,unsigned long value);
 





 
 void SetSliderValue(unsigned short int screen_id,unsigned short int control_id,unsigned long value);
 





 
 void SetSelectorValue(unsigned short int screen_id,unsigned short int control_id,unsigned char item);
 




 
 void AnimationStart(unsigned short int screen_id,unsigned short int control_id);
 




 
 void AnimationStop(unsigned short int screen_id,unsigned short int control_id);
 




 
 void AnimationPause(unsigned short int screen_id,unsigned short int control_id);
 





 
 void AnimationPlayFrame(unsigned short int screen_id,unsigned short int control_id,unsigned char frame_id);
 




 
 void AnimationPlayPrev(unsigned short int screen_id,unsigned short int control_id);
 




 
 void AnimationPlayNext(unsigned short int screen_id,unsigned short int control_id);
 






 
 void GraphChannelAdd(unsigned short int screen_id,unsigned short int control_id,unsigned char channel,unsigned short int color);
 





 
 void GraphChannelDel(unsigned short int screen_id,unsigned short int control_id,unsigned char channel);
 







 
 void GraphChannelDataAdd(unsigned short int screen_id,unsigned short int control_id,unsigned char channel,unsigned char *pData,unsigned short int nDataLen);
 
 void GraphChannelADDByte(unsigned short int screen_id,unsigned short int control_id,unsigned char channel,unsigned char Data);





 
 void GraphChannelDataClear(unsigned short int screen_id,unsigned short int control_id,unsigned char channel);
 








 
 void GraphSetViewport(unsigned short int screen_id,unsigned short int control_id,short int x_offset,unsigned short int x_mul,short int y_offset,unsigned short int y_mul);
 
 void HistoryGraph2ChannelSetValueInt16(unsigned short int screen_id,unsigned short int control_id,unsigned short int channel1Value,unsigned short int channel2Value);
 



 
 void BatchBegin(unsigned short int screen_id);
 




 
 void BatchSetButtonValue(unsigned short int control_id,unsigned char state);
 




 
 void BatchSetProgressValue(unsigned short int control_id,unsigned long value);
 




 
 void BatchSetSliderValue(unsigned short int control_id,unsigned long value);
 




 
 void BatchSetMeterValue(unsigned short int control_id,unsigned long value);
 




 
 void BatchSetText(unsigned short int control_id,unsigned char *strings);
 




 
 void BatchSetFrame(unsigned short int control_id,unsigned short int frame_id);
 


 
 void BatchEnd();
 





 
 void SetTimer(unsigned short int screen_id,unsigned short int control_id,unsigned long timeout);
 




 
 void StartTimer(unsigned short int screen_id,unsigned short int control_id);
 




 
 void StopTimer(unsigned short int screen_id,unsigned short int control_id);
 




 
 void PauseTimer(unsigned short int screen_id,unsigned short int control_id);
 






 
 void SetControlBackColor(unsigned short int screen_id,unsigned short int control_id,unsigned short int color);
 






 
 void SetControlForeColor(unsigned short int screen_id,unsigned short int control_id,unsigned short int color);
 






 
 void ShowPopupMenu(unsigned short int screen_id,unsigned short int control_id,unsigned char show,unsigned short int focus_control_id);
 








 
 void ShowKeyboard(unsigned char show,unsigned short int x,unsigned short int y,unsigned char type,unsigned char option,unsigned char max_len);
 
 void GetRTC(void);
 void SetRecordValue(unsigned short int screen_id,unsigned short int control_id,unsigned char *str) ;   
 void SetRecordScrooPos(unsigned short int screen_id,unsigned short int control_id,unsigned short int Pos);    
 void DeletAllRecord(unsigned short int screen_id,unsigned short int control_id);   
 void GetRecordNum(unsigned short int screen_id,unsigned short int control_id)  ;  
 void ModifyRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int POSITION,unsigned char *str)  ;  
 void DeletRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int POSITION) ;   
 void SetRecordScrooPos(unsigned short int screen_id,unsigned short int control_id,unsigned short int Pos);	   
 void InsertRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int POSITION,unsigned char *str) ;   
 void ReadRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int Pos);    
 void SelectRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int POSITION) ;   





 
 void IconPlayFrame(unsigned short int screen_id,unsigned short int control_id,unsigned char frame_id);
 




 
 void IconPlayPrev(unsigned short int screen_id,unsigned short int control_id);
 




 
 void IconPlayNext(unsigned short int screen_id,unsigned short int control_id);
 
 
#line 1 "..\user\hmi_driver.c" /0
 
 
 
 
 
 
 
 
 
#line 10 "..\user\hmi_driver.c" /1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#line 64 "..\user\hmi_driver.c" /0
 
 
 
 
 
 
 
 void DelayMS(unsigned int n) 
 {
 int i,j;  
 for(i = n;i>0;i--)
 for(j=1000;j>0;j--) ; 
 }
 
 void SendStrings(unsigned char *str)
 {
 while(*str)
 {
   SendChar((*str)&0xFF);
 str++;
 }
 }
 
 void SendNU8(unsigned char *pData,unsigned short int nDataLen)
 {
  unsigned short int i = 0;
 for (;i<nDataLen;++i)
 {
   SendChar((pData[i])&0xFF);
 }
 }
 
 void SendNU16(unsigned short int *pData,unsigned short int nDataLen)
 {
  unsigned short int i = 0;
 for (;i<nDataLen;++i)
 {
    SendChar(((pData[i])>>8)&0xFF);SendChar((pData[i])&0xFF);
 }
 }
 
 void SetHandShake()   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x00)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetFcolor(unsigned short int color)  
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x41)&0xFF);
    SendChar(((color)>>8)&0xFF);SendChar((color)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetBcolor(unsigned short int color)   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x42)&0xFF);
    SendChar(((color)>>8)&0xFF);SendChar((color)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void ColorPicker(unsigned char mode, unsigned short int x,unsigned short int y)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xA3)&0xFF);
   SendChar((mode)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_CleanScreen()
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x01)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetTextSpace(unsigned char x_w, unsigned char y_w)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x43)&0xFF);
   SendChar((x_w)&0xFF);
   SendChar((y_w)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetFont_Region(unsigned char enable,unsigned short int width,unsigned short int height)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x45)&0xFF);
   SendChar((enable)&0xFF);
    SendChar(((width)>>8)&0xFF);SendChar((width)&0xFF);
    SendChar(((height)>>8)&0xFF);SendChar((height)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetFilterColor(unsigned short int fillcolor_dwon, unsigned short int fillcolor_up)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x44)&0xFF);
    SendChar(((fillcolor_dwon)>>8)&0xFF);SendChar((fillcolor_dwon)&0xFF);
    SendChar(((fillcolor_up)>>8)&0xFF);SendChar((fillcolor_up)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void DisText(unsigned short int x, unsigned short int y,unsigned char back,unsigned char font,unsigned char *strings )
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x20)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
   SendChar((back)&0xFF);
   SendChar((font)&0xFF);
 SendStrings(strings);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void DisCursor(unsigned char enable,unsigned short int x, unsigned short int y,unsigned char width,unsigned char height )
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x21)&0xFF);
   SendChar((enable)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
   SendChar((width)&0xFF);
   SendChar((height)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void DisFull_Image(unsigned short int image_id,unsigned char masken)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x31)&0xFF);
    SendChar(((image_id)>>8)&0xFF);SendChar((image_id)&0xFF);
   SendChar((masken)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void DisArea_Image(unsigned short int x,unsigned short int y,unsigned short int image_id,unsigned char masken)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x32)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
    SendChar(((image_id)>>8)&0xFF);SendChar((image_id)&0xFF);
   SendChar((masken)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void DisCut_Image(unsigned short int x,unsigned short int y,unsigned short int image_id,unsigned short int image_x,unsigned short int image_y,unsigned short int image_l, unsigned short int image_w,unsigned char masken)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x33)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
    SendChar(((image_id)>>8)&0xFF);SendChar((image_id)&0xFF);
    SendChar(((image_x)>>8)&0xFF);SendChar((image_x)&0xFF);
    SendChar(((image_y)>>8)&0xFF);SendChar((image_y)&0xFF);
    SendChar(((image_l)>>8)&0xFF);SendChar((image_l)&0xFF);
    SendChar(((image_w)>>8)&0xFF);SendChar((image_w)&0xFF);
   SendChar((masken)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void DisFlashImage(unsigned short int x,unsigned short int y,unsigned short int flashimage_id,unsigned char enable,unsigned char playnum)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x80)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
    SendChar(((flashimage_id)>>8)&0xFF);SendChar((flashimage_id)&0xFF);
   SendChar((enable)&0xFF);
   SendChar((playnum)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_Dot(unsigned short int x,unsigned short int y)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x50)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_Line(unsigned short int x0, unsigned short int y0, unsigned short int x1, unsigned short int y1)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x51)&0xFF);
    SendChar(((x0)>>8)&0xFF);SendChar((x0)&0xFF);
    SendChar(((y0)>>8)&0xFF);SendChar((y0)&0xFF);
    SendChar(((x1)>>8)&0xFF);SendChar((x1)&0xFF);
    SendChar(((y1)>>8)&0xFF);SendChar((y1)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_ConDots(unsigned char mode,unsigned short int *dot,unsigned short int dot_cnt)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x63)&0xFF);
   SendChar((mode)&0xFF);
  SendNU16((unsigned short int *)dot,dot_cnt*2);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_ConSpaceDots(unsigned short int x,unsigned short int x_space,unsigned short int *dot_y,unsigned short int dot_cnt)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x59)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((x_space)>>8)&0xFF);SendChar((x_space)&0xFF);
  SendNU16((unsigned short int *)dot_y,dot_cnt);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_FcolorConOffsetDots(unsigned short int x,unsigned short int y,unsigned short int *dot_offset,unsigned short int dot_cnt)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x75)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
  SendNU16((unsigned short int *)dot_offset,dot_cnt);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_BcolorConOffsetDots(unsigned short int x,unsigned short int y,unsigned char *dot_offset,unsigned short int dot_cnt)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x76)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
  SendNU16((unsigned short int *)dot_offset,dot_cnt);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetPowerSaving(unsigned char enable, unsigned char bl_off_level, unsigned char bl_on_level, unsigned char  bl_on_time)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x77)&0xFF);
   SendChar((enable)&0xFF);
   SendChar((bl_off_level)&0xFF);
   SendChar((bl_on_level)&0xFF);
   SendChar((bl_on_time)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_FcolorConDots(unsigned short int *dot,unsigned short int dot_cnt)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x68)&0xFF);
  SendNU16((unsigned short int *)dot,dot_cnt*2);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_BcolorConDots(unsigned short int *dot,unsigned short int dot_cnt)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x69)&0xFF);
  SendNU16((unsigned short int *)dot,dot_cnt*2);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_Circle(unsigned short int x, unsigned short int y, unsigned short int r)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x52)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
    SendChar(((r)>>8)&0xFF);SendChar((r)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_CircleFill(unsigned short int x, unsigned short int y, unsigned short int r)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x53)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
    SendChar(((r)>>8)&0xFF);SendChar((r)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_Arc(unsigned short int x,unsigned short int y, unsigned short int r,unsigned short int sa, unsigned short int ea)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x67)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
    SendChar(((r)>>8)&0xFF);SendChar((r)&0xFF);
    SendChar(((sa)>>8)&0xFF);SendChar((sa)&0xFF);
    SendChar(((ea)>>8)&0xFF);SendChar((ea)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_Rectangle(unsigned short int x0, unsigned short int y0, unsigned short int x1,unsigned short int y1 )
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x54)&0xFF);
    SendChar(((x0)>>8)&0xFF);SendChar((x0)&0xFF);
    SendChar(((y0)>>8)&0xFF);SendChar((y0)&0xFF);
    SendChar(((x1)>>8)&0xFF);SendChar((x1)&0xFF);
    SendChar(((y1)>>8)&0xFF);SendChar((y1)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_RectangleFill(unsigned short int x0, unsigned short int y0, unsigned short int x1,unsigned short int y1 )
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x55)&0xFF);
    SendChar(((x0)>>8)&0xFF);SendChar((x0)&0xFF);
    SendChar(((y0)>>8)&0xFF);SendChar((y0)&0xFF);
    SendChar(((x1)>>8)&0xFF);SendChar((x1)&0xFF);
    SendChar(((y1)>>8)&0xFF);SendChar((y1)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_Ellipse(unsigned short int x0, unsigned short int y0, unsigned short int x1,unsigned short int y1 )
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x56)&0xFF);
    SendChar(((x0)>>8)&0xFF);SendChar((x0)&0xFF);
    SendChar(((y0)>>8)&0xFF);SendChar((y0)&0xFF);
    SendChar(((x1)>>8)&0xFF);SendChar((x1)&0xFF);
    SendChar(((y1)>>8)&0xFF);SendChar((y1)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_EllipseFill(unsigned short int x0, unsigned short int y0, unsigned short int x1,unsigned short int y1 )
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x57)&0xFF);
    SendChar(((x0)>>8)&0xFF);SendChar((x0)&0xFF);
    SendChar(((y0)>>8)&0xFF);SendChar((y0)&0xFF);
    SendChar(((x1)>>8)&0xFF);SendChar((x1)&0xFF);
    SendChar(((y1)>>8)&0xFF);SendChar((y1)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetBackLight(unsigned char light_level)   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x60)&0xFF);
   SendChar((light_level)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetBuzzer(unsigned char time)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x61)&0xFF);
   SendChar((time)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_AreaInycolor(unsigned short int x0, unsigned short int y0, unsigned short int x1,unsigned short int y1 )
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x65)&0xFF);
    SendChar(((x0)>>8)&0xFF);SendChar((x0)&0xFF);
    SendChar(((y0)>>8)&0xFF);SendChar((y0)&0xFF);
    SendChar(((x1)>>8)&0xFF);SendChar((x1)&0xFF);
    SendChar(((y1)>>8)&0xFF);SendChar((y1)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetTouchPaneOption(unsigned char enbale,unsigned char beep_on,unsigned char work_mode,unsigned char press_calibration)
 {
  unsigned char options = 0;
 
 if(enbale)
 options |= 0x01;
 if(beep_on)
 options |= 0x02;
 if(work_mode)
 options |= (work_mode<<2);
 if(press_calibration)
 options |= (press_calibration<<5);
 
    SendChar((0XEE)&0xFF);
   SendChar((0x70)&0xFF);
   SendChar((options)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void CalibrateTouchPane()
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x72)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void TestTouchPane()
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x73)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void LockDeviceConfig(void)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x09)&0xFF);
   SendChar((0xDE)&0xFF);
   SendChar((0xED)&0xFF);
   SendChar((0x13)&0xFF);
   SendChar((0x31)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void UnlockDeviceConfig(void)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x08)&0xFF);
   SendChar((0xA5)&0xFF);
   SendChar((0x5A)&0xFF);
   SendChar((0x5F)&0xFF);
   SendChar((0xF5)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetCommBps(unsigned char option)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xA0)&0xFF);
   SendChar((option)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void WriteLayer(unsigned char layer)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xA1)&0xFF);
   SendChar((layer)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void DisplyLayer(unsigned char layer)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xA2)&0xFF);
   SendChar((layer)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void CopyLayer(unsigned char src_layer,unsigned char dest_layer)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xA4)&0xFF);
   SendChar((src_layer)&0xFF);
   SendChar((dest_layer)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void ClearLayer(unsigned char layer)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x05)&0xFF);
   SendChar((layer)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GUI_DispRTC(unsigned char enable,unsigned char mode,unsigned char font,unsigned short int color,unsigned short int x,unsigned short int y)	  
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x85)&0xFF);
   SendChar((enable)&0xFF);
   SendChar((mode)&0xFF);
   SendChar((font)&0xFF);
    SendChar(((color)>>8)&0xFF);SendChar((color)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void WriteUserFlash(unsigned long startAddress,unsigned short int length,unsigned char *_data)	   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x87)&0xFF);
     SendChar((((startAddress)>>16)>>8)&0xFF);SendChar(((startAddress)>>16)&0xFF);SendChar((((startAddress)&0xFFFF)>>8)&0xFF);SendChar(((startAddress)&0xFFFF)&0xFF);
  SendNU8((unsigned char *)_data,length);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void ReadUserFlash(unsigned long startAddress,unsigned short int length )	  
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x88)&0xFF);
     SendChar((((startAddress)>>16)>>8)&0xFF);SendChar(((startAddress)>>16)&0xFF);SendChar((((startAddress)&0xFFFF)>>8)&0xFF);SendChar(((startAddress)&0xFFFF)&0xFF);
    SendChar(((length)>>8)&0xFF);SendChar((length)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GetScreen()	   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x01)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetScreen(unsigned short int screen_id)	  
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x00)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetScreenUpdateEnable(unsigned char enable)	   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB3)&0xFF);
   SendChar((enable)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetControlFocus(unsigned short int screen_id,unsigned short int control_id,unsigned char focus)	  
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x02)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((focus)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetControlVisiable(unsigned short int screen_id,unsigned short int control_id,unsigned char visible)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x03)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((visible)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetControlEnable(unsigned short int screen_id,unsigned short int control_id,unsigned char enable)	    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x04)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((enable)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetButtonValue(unsigned short int screen_id,unsigned short int control_id,unsigned char state)	   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x10)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((state)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetTextValue(unsigned short int screen_id,unsigned short int control_id,unsigned char *str)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x10)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
 SendStrings(str);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetProgressValue(unsigned short int screen_id,unsigned short int control_id,unsigned long value)	 
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x10)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
     SendChar((((value)>>16)>>8)&0xFF);SendChar(((value)>>16)&0xFF);SendChar((((value)&0xFFFF)>>8)&0xFF);SendChar(((value)&0xFFFF)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetMeterValue(unsigned short int screen_id,unsigned short int control_id,unsigned long value)	   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x10)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
     SendChar((((value)>>16)>>8)&0xFF);SendChar(((value)>>16)&0xFF);SendChar((((value)&0xFFFF)>>8)&0xFF);SendChar(((value)&0xFFFF)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetSliderValue(unsigned short int screen_id,unsigned short int control_id,unsigned long value)   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x10)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
     SendChar((((value)>>16)>>8)&0xFF);SendChar(((value)>>16)&0xFF);SendChar((((value)&0xFFFF)>>8)&0xFF);SendChar(((value)&0xFFFF)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetSelectorValue(unsigned short int screen_id,unsigned short int control_id,unsigned char item)  
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x10)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((item)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GetControlValue(unsigned short int screen_id,unsigned short int control_id)	    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x11)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void AnimationStart(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x20)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void AnimationStop(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x21)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void AnimationPause(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x22)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void AnimationPlayFrame(unsigned short int screen_id,unsigned short int control_id,unsigned char frame_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x23)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((frame_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void AnimationPlayPrev(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x24)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void AnimationPlayNext(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x25)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GraphChannelAdd(unsigned short int screen_id,unsigned short int control_id,unsigned char channel,unsigned short int color)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x30)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((channel)&0xFF);
    SendChar(((color)>>8)&0xFF);SendChar((color)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GraphChannelDel(unsigned short int screen_id,unsigned short int control_id,unsigned char channel)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x31)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((channel)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GraphChannelDataAdd(unsigned short int screen_id,unsigned short int control_id,unsigned char channel,unsigned char *pData,unsigned short int nDataLen)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x32)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((channel)&0xFF);
    SendChar(((nDataLen)>>8)&0xFF);SendChar((nDataLen)&0xFF);
  SendNU8((unsigned char *)pData,nDataLen);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 void GraphChannelADDByte(unsigned short int screen_id,unsigned short int control_id,unsigned char channel,unsigned char Data)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x32)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((channel)&0xFF);
    SendChar(((1)>>8)&0xFF);SendChar((1)&0xFF);
   SendChar((Data)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GraphChannelDataClear(unsigned short int screen_id,unsigned short int control_id,unsigned char channel)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x33)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((channel)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GraphSetViewport(unsigned short int screen_id,unsigned short int control_id,short int x_offset,unsigned short int x_mul,short int y_offset,unsigned short int y_mul)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x34)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((x_offset)>>8)&0xFF);SendChar((x_offset)&0xFF);
    SendChar(((x_mul)>>8)&0xFF);SendChar((x_mul)&0xFF);
    SendChar(((y_offset)>>8)&0xFF);SendChar((y_offset)&0xFF);
    SendChar(((y_mul)>>8)&0xFF);SendChar((y_mul)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void HistoryGraphChannelSetValueInt16(unsigned short int screen_id,unsigned short int control_id,unsigned short int channel1Value)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x60)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((channel1Value)>>8)&0xFF);SendChar((channel1Value)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void HistoryGraph2ChannelSetValueInt16(unsigned short int screen_id,unsigned short int control_id,unsigned short int channel1Value,unsigned short int channel2Value)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x60)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((channel1Value)>>8)&0xFF);SendChar((channel1Value)&0xFF);
    SendChar(((channel2Value)>>8)&0xFF);SendChar((channel2Value)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 void BatchBegin(unsigned short int screen_id)	   
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x12)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
 }
 
 void BatchSetButtonValue(unsigned short int control_id,unsigned char state)	   
 {
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((1)>>8)&0xFF);SendChar((1)&0xFF);
   SendChar((state)&0xFF);
 }
 
 void BatchSetProgressValue(unsigned short int control_id,unsigned long value)	  
 {
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((4)>>8)&0xFF);SendChar((4)&0xFF);
     SendChar((((value)>>16)>>8)&0xFF);SendChar(((value)>>16)&0xFF);SendChar((((value)&0xFFFF)>>8)&0xFF);SendChar(((value)&0xFFFF)&0xFF);
 }
 
 void BatchSetSliderValue(unsigned short int control_id,unsigned long value)    
 {
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((4)>>8)&0xFF);SendChar((4)&0xFF);
     SendChar((((value)>>16)>>8)&0xFF);SendChar(((value)>>16)&0xFF);SendChar((((value)&0xFFFF)>>8)&0xFF);SendChar(((value)&0xFFFF)&0xFF);
 }
 
 void BatchSetMeterValue(unsigned short int control_id,unsigned long value)	 
 {
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((4)>>8)&0xFF);SendChar((4)&0xFF);
     SendChar((((value)>>16)>>8)&0xFF);SendChar(((value)>>16)&0xFF);SendChar((((value)&0xFFFF)>>8)&0xFF);SendChar(((value)&0xFFFF)&0xFF);
 }
 
  unsigned long GetStringLen(unsigned char *str)		 
 {
  unsigned char *p = str;
 while(*str)
 {
 str++;
 }
 
 return (str-p);
 } 
 
 void BatchSetText(unsigned short int control_id,unsigned char *strings)	 
 {
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((GetStringLen(strings))>>8)&0xFF);SendChar((GetStringLen(strings))&0xFF);
 SendStrings(strings);
 }
 
 void BatchSetFrame(unsigned short int control_id,unsigned short int frame_id)
 {
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((2)>>8)&0xFF);SendChar((2)&0xFF);
    SendChar(((frame_id)>>8)&0xFF);SendChar((frame_id)&0xFF);
 }
 
 void BatchEnd()		 
 {
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetTimer(unsigned short int screen_id,unsigned short int control_id,unsigned long timeout)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x40)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
     SendChar((((timeout)>>16)>>8)&0xFF);SendChar(((timeout)>>16)&0xFF);SendChar((((timeout)&0xFFFF)>>8)&0xFF);SendChar(((timeout)&0xFFFF)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void StartTimer(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x41)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void StopTimer(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x42)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 
 void PauseTimer(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x44)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }










 
 
 void GetTimerValue(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x45)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 
 
 
 void SetControlBackColor(unsigned short int screen_id,unsigned short int control_id,unsigned short int color)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x18)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((color)>>8)&0xFF);SendChar((color)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void SetControlForeColor(unsigned short int screen_id,unsigned short int control_id,unsigned short int color)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x19)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
    SendChar(((color)>>8)&0xFF);SendChar((color)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void ShowPopupMenu(unsigned short int screen_id,unsigned short int control_id,unsigned char show,unsigned short int focus_control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x13)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((show)&0xFF);
    SendChar(((focus_control_id)>>8)&0xFF);SendChar((focus_control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void ShowKeyboard(unsigned char show,unsigned short int x,unsigned short int y,unsigned char type,unsigned char option,unsigned char max_len)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x86)&0xFF);
   SendChar((show)&0xFF);
    SendChar(((x)>>8)&0xFF);SendChar((x)&0xFF);
    SendChar(((y)>>8)&0xFF);SendChar((y)&0xFF);
   SendChar((type)&0xFF);
   SendChar((option)&0xFF);
   SendChar((max_len)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 void GetRTC(void)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0x82)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 void SetRecordValue(unsigned short int screen_id,unsigned short int control_id,unsigned char *str)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x52)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);				  
 SendStrings(str);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void DeletAllRecord(unsigned short int screen_id,unsigned short int control_id)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x53)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);	
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 
 }
 void SetRecordScrooPos(unsigned short int screen_id,unsigned short int control_id,unsigned short int Pos)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x54)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);				  
    SendChar(((Pos)>>8)&0xFF);SendChar((Pos)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void GetRecordNum(unsigned short int screen_id,unsigned short int control_id)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x55)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);				  
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }







 
 void ReadRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int Pos)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x56)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);				  
    SendChar(((Pos)>>8)&0xFF);SendChar((Pos)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void ModifyRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int POSITION,unsigned char *str)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x57)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);	
    SendChar(((POSITION)>>8)&0xFF);SendChar((POSITION)&0xFF); 
 SendStrings(str);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 
 }
 void DeletRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int POSITION)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x58)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);	
    SendChar(((POSITION)>>8)&0xFF);SendChar((POSITION)&0xFF);  
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 
 }
 
 void InsertRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int POSITION,unsigned char *str)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x59)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);	
    SendChar(((POSITION)>>8)&0xFF);SendChar((POSITION)&0xFF); 
 SendStrings(str);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 
 }
 void SelectRecord(unsigned short int screen_id,unsigned short int control_id,unsigned short int POSITION)    
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x5A)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);	
    SendChar(((POSITION)>>8)&0xFF);SendChar((POSITION)&0xFF); 
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 
 }










 
 
 
 
 
 
 










 
 void ExploRecordToSD(unsigned short int screen_id,unsigned short int control_id)  
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x5C)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);	
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 void IconPlayFrame(unsigned short int screen_id,unsigned short int control_id,unsigned char frame_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x23)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
   SendChar((frame_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void IconPlayPrev(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x24)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
 
 void IconPlayNext(unsigned short int screen_id,unsigned short int control_id)
 {
    SendChar((0XEE)&0xFF);
   SendChar((0xB1)&0xFF);
   SendChar((0x25)&0xFF);
    SendChar(((screen_id)>>8)&0xFF);SendChar((screen_id)&0xFF);
    SendChar(((control_id)>>8)&0xFF);SendChar((control_id)&0xFF);
      SendChar((((0XFFFCFFFF)>>16)>>8)&0xFF);SendChar(((0XFFFCFFFF)>>16)&0xFF);SendChar((((0XFFFCFFFF)&0xFFFF)>>8)&0xFF);SendChar(((0XFFFCFFFF)&0xFFFF)&0xFF);
 }
